<template>
    <div class="document">
      <h2 class="title">{{title}}</h2>
      <div class="content">123</div>
      <el-button type="success" @click="changTitle">修改标题</el-button>
    </div>
</template>
<script>
export default {
components: {},
props:{
  title:{
    type:String,
    default:''
  }
},
data() {
  return {

  }
},
created(){

},
methods:{
changTitle(){
  //子组件派发自定义事件，父组件监听自定义事件
  this.$emit('update:title','新标题')
}
}

}

</script>
<style lang="scss" scoped>

</style>
